package com.food.controller;


import com.food.configure.Result;
import com.food.entity.MaterialLog;
import com.food.service.MaterialLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author
 * @since 2021-04-04
 */
@RestController
@RequestMapping("/materialLog")
public class MaterialLogController {

    @Autowired
    MaterialLogService materialLogService;

    /**
     * 添加/修改--库存材料变动/编辑--记录日志
     */
    @RequestMapping("/updateMaterialLog")
    public Result<MaterialLog> updateMaterialLog(@RequestBody MaterialLog materialLog) {
        return materialLogService.updateMaterialLog(materialLog);
    }

    /**
     * 删除
     */
    @RequestMapping("/delMaterialLog")
    public Result<MaterialLog> delMaterialLog(@RequestBody MaterialLog materialLog) {
        return materialLogService.delMaterialLog(materialLog);
    }

    /**
     * 批量删除
     */
    @RequestMapping("/batchDelMaterialLog")
    public Result<MaterialLog> batchDelMaterialLog(@RequestBody MaterialLog materialLog) {
        return materialLogService.batchDelMaterialLog(materialLog);
    }

    /**
     * 查询(不分页)
     */
    @RequestMapping("/queryMaterialLog")
    public Result<MaterialLog> queryMaterialLog(@RequestBody MaterialLog materialLog) {
        return materialLogService.queryMaterialLog(materialLog);
    }

    /**
     * 查询(分页)--库存日志--按照材料名称搜--下拉栏
     */
    @RequestMapping("/queryMaterialLogByPage")
    public Result<MaterialLog> queryMaterialLogByPage(@RequestBody MaterialLog materialLog) {
        return materialLogService.queryMaterialLogByPage(materialLog);
    }

    /**
     * 根据ID查询
     */
    @RequestMapping("/queryMaterialLogById")
    public Result<MaterialLog> queryMaterialLogById(@RequestBody MaterialLog materialLog) {
        return materialLogService.queryMaterialLogById(materialLog);
    }

}

